package com.jt.www.domain.dto;

import com.jt.www.domain.enums.common.IndustryStatusEnum;
import com.jt.www.domain.enums.pc.AdminLevelEnum;
import com.jt.www.domain.po.IndustryManager;
import com.jt.www.util.DateUtils;
import io.swagger.annotations.ApiModelProperty;

/**
 * Created by shaoyn on 2020/12/09.
 */
public class IndustryManagerDto {

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "用户userCode")
    private String userCode;

    @ApiModelProperty(value = "帐号")
    private String account;

    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @ApiModelProperty(value = "分支机构编码")
    private String branchCode;

    @ApiModelProperty(value = "分支机构名称")
    private String branchName;

    @ApiModelProperty(value = "机构名称")
    private String orgName;

    @ApiModelProperty(value = "地区权限code，逗号分割")
    private String areaAuthorityCode;

    @ApiModelProperty(value = "地区权限name，逗号分割")
    private String areaAuthorityName;

    @ApiModelProperty(value = "行政级别: 1-省级;2-市级;3-区级")
    private Byte adminLevel;

    @ApiModelProperty(value = "行政级别")
    private String adminLevelDesc;

    @ApiModelProperty(value = "联系电话")
    private String linkPhone;

    @ApiModelProperty(value = "邮箱地址")
    private String email;

    @ApiModelProperty(value = "备注")
    private String remarks;

    @ApiModelProperty(value = "状态,0-失效，1-生效")
    private Byte status;

    @ApiModelProperty(value = "状态,1-启用中  2-已停用")
    private String statusDesc;

    @ApiModelProperty(value = "注册时间")
    private String createTime;

    public IndustryManagerDto(IndustryManager industryManager) {
        this.id = industryManager.getId();
        this.userCode = industryManager.getUserCode();
        this.account = industryManager.getAccount();
        this.userName = industryManager.getUserName();
        this.branchCode = industryManager.getBranchCode();
        this.branchName = industryManager.getBranchName();
        this.orgName = industryManager.getOrgName();
        this.areaAuthorityCode = industryManager.getAreaAuthorityCode();
        this.areaAuthorityName = industryManager.getAreaAuthorityName();
        this.adminLevel = industryManager.getAdminLevel();
        this.adminLevelDesc = AdminLevelEnum.getDescByLevel(industryManager.getAdminLevel());
        this.linkPhone = industryManager.getLinkPhone();
        this.email = industryManager.getEmail();
        this.remarks = industryManager.getRemarks();
        this.status = industryManager.getStatus();
        this.statusDesc = IndustryStatusEnum.getDescByValue(industryManager.getStatus());
        if (null != industryManager.getCreateTime()) {
            this.createTime = DateUtils.format(industryManager.getCreateTime(), DateUtils.DATE_TIME_FORMAT_YYYY_MM_DD_HH_MI_SS);
        }
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getBranchCode() {
        return branchCode;
    }

    public void setBranchCode(String branchCode) {
        this.branchCode = branchCode;
    }

    public String getBranchName() {
        return branchName;
    }

    public void setBranchName(String branchName) {
        this.branchName = branchName;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getAreaAuthorityCode() {
        return areaAuthorityCode;
    }

    public void setAreaAuthorityCode(String areaAuthorityCode) {
        this.areaAuthorityCode = areaAuthorityCode;
    }

    public String getAreaAuthorityName() {
        return areaAuthorityName;
    }

    public void setAreaAuthorityName(String areaAuthorityName) {
        this.areaAuthorityName = areaAuthorityName;
    }

    public Byte getAdminLevel() {
        return adminLevel;
    }

    public void setAdminLevel(Byte adminLevel) {
        this.adminLevel = adminLevel;
    }

    public String getAdminLevelDesc() {
        return adminLevelDesc;
    }

    public void setAdminLevelDesc(String adminLevelDesc) {
        this.adminLevelDesc = adminLevelDesc;
    }

    public String getLinkPhone() {
        return linkPhone;
    }

    public void setLinkPhone(String linkPhone) {
        this.linkPhone = linkPhone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getStatusDesc() {
        return statusDesc;
    }

    public void setStatusDesc(String statusDesc) {
        this.statusDesc = statusDesc;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
